﻿#ifndef SENDER_H
#define SENDER_H

#include <iostream>

#include <thread>
#include <boost/asio.hpp>

using namespace boost;

class Sender {

public:
	Sender(asio::io_context& context, const asio::ip::address& addr);

private:
	void do_send();
	void do_timeout();

private:
	int message_count_ = 0;
	int message_limit_ = 100;
	int multicast_port_ = 30001;
	std::string message_;

	asio::ip::udp::endpoint endpoint_;
	asio::ip::udp::socket socket_;
	asio::steady_timer timer_;

};

#endif //SENDER_H
